import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import legacy from '@vitejs/plugin-legacy'

// https://vite.dev/config/
export default defineConfig({
  base: "./",//解决打包后的白屏问题
  plugins: [
    vue(),
    legacy({
      targets: ['ie>=8'],
      additionalLegacyPolyfills: ['regenerator-runtime/runtime']
    })
  ],
  server: {
    host: "0.0.0.0",
    proxy: {

      "^/dev-api": {
        target: "http://192.168.3.63:8085",
        rewrite: (path) => path.replace(/^\/dev-api/, ""),
      },
    },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
})
